//引入axios请求
import request from '@/utils/request';

//1.登入请求

//登入请求类型
export interface reqLoginType {
    username:string,
    password:string
}

//登入请求返回值类型
export interface reqLoginReturnType {
    token:string
}

//请求函数
export const getLoginRequest = (loginParams:reqLoginType) => {
    return request.post<any,reqLoginReturnType>("/admin/acl/index/login",loginParams)
}

//2.获取用户信息

//获取用户信息返回值类型
export interface getUserInfoType {
    routes: string[];
    buttons: string[];
    roles: string[];
    name: string;
    avatar: string;
}

//请求函数
export const getUserInfoRequest = () => {
    return request.get<any,getUserInfoType>("/admin/acl/index/info")
}

//3.退出登入请求

//请求函数
export const getLogoutRequest = () => {
    return request.post<any,null>("/admin/acl/index/logout")
}